﻿//   new、delete练习1，为单个变量分配空间
#include <iostream>
using namespace std;

int main(void)
{
	int* p1, * p2;
	p1 = new int;           //DONE 为简单变量分配内存
	p2 = new int(6);     //DONE 为简单变量分配内存，并初始化为6
	*p1 = 10;
	cout << *p1 << endl;
	cout << *p2 << endl;
	delete p1;		//DONE 释放动态申请的空间
	delete p2;
	cin.ignore();
	return 0;
}   /*end main*/
